<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
      xmlns:th="http://www.thymeleaf.org"
      layout:decorator="backstage/layout">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=8" />
    <title>网站底部维护</title>
</head>

<body>
<div id="content" layout:fragment="content">
    <script type="text/javascript">
	
		function submitF(){
			$("#loadingDiv").show();
			$("#editcontent").ajaxSubmit(function(date){
				$("#loadingDiv").hide();
                if(date.suc){
                    alert("操作成功了！");                  
                    window.location.href = "/footer/footerForm.htm";
                }else {
	                alert("保存失败了！" + date.msg);
	            }
            });
		}
	
    </script>
    <div class="box-content">
        <div class="row-fluid sortable">
            <div class="box span12">
                <h3 class="row-fluid header smaller lighter blue">
                   <span class="label label-large label-pink arrowed-right">网站底部管理</span>
                </h3>                               
                <div class="box-content">  
                <form action="/footer/addOrUpdate.json" method="post" id="editcontent" enctype="multipart/form-data">                
                    <table class="table table-striped table-bordered bootstrap-datatable datatable">
	                    <tr th:if="${footerL.size()>0}" th:each="footer,indexStat1:${footerL}">
		                    <td style="width:280px;">
		                    	标题：<input name="title" type="text" th:value="${footer.name}"/>					                      				                     
		                    </td>
		                    <td>
		                    <table class="table table-striped table-bordered bootstrap-datatable datatable" th:if="${footer!=null}" >                       			 		
				                        <tr th:each="footerD,indexStat:${footer.footerList}">
				                        	<th th:if="${4>indexStat1.index}" style="text-align: center;">内容：<input th:name="${'title'+indexStat1.count}" type="text" th:value="${footerD.name}"/></th>
				                            <th th:if="${4>indexStat1.index}" style="text-align: center;">url:<input th:name="${'url'+indexStat1.count}" type="text" th:value="${footerD.footerHref}"/></th>
				                        	<td th:if="${indexStat1.index==4 || indexStat1.index==5}">
						                    <input type="file" th:name="${'file'+indexStat1.index}"/>
						                    <img th:src="${footerD.imgUrl}"/>
						                    <input type="hidden" th:name="${'img'+indexStat1.index}" th:value="${footerD.imgHref}"/>
						                    </td>
				                        </tr>				                        				                        			                                              			
                       			</table>
		                    </td>
	                    </tr>
	                    <tr th:if="${footerL.size()==0}">
		                    <td style="width:280px;">
		                    	标题：<input name="title" type="text"/>					                      
				                     
		                    </td>
		                    <td>
		                    <table class="table table-striped table-bordered bootstrap-datatable datatable">                       			 		
				                        <tr>
				                        	<th style="text-align: center;">内容：<input name="title1" type="text"/></th>
				                            <th style="text-align: center;">url:<input name="url1" type="text"/></th>
				                        </tr>				                        				                        
				                         <tr>
				                        	<th style="text-align: center;">内容：<input name="title1" type="text" /></th>
				                            <th style="text-align: center;">url:<input name="url1" type="text" /></th>						                      
				                        </tr>
				                        <tr>
				                        	<th style="text-align: center;">内容：<input name="title1" type="text" /></th>
				                            <th style="text-align: center;">url:<input name="url1" type="text" /></th>		
				                        </tr>
				                        <tr>
				                        	<th style="text-align: center;">内容：<input name="title1" type="text" /></th>
				                            <th style="text-align: center;">url:<input name="url1" type="text" /></th>					                          
				                        </tr>			                                              			
                       			</table>
		                    </td>
	                    </tr>
	                    <tr th:if="${footerL.size()==0}">
		                    <td>
		                    	标题：<input name="title" type="text"/>					                      
				                     
		                    </td>
		                    <td>
		                    <table class="table table-striped table-bordered bootstrap-datatable datatable">                       			 		
				                        <tr>
				                        	<th style="text-align: center;">内容：<input name="title2" type="text" /></th>
				                            <th style="text-align: center;">url:<input name="url2" type="text" /></th>
				                        </tr>
				                        <tr>
				                        	<th style="text-align: center;">内容：<input name="title2" type="text" /></th>
				                            <th style="text-align: center;">url:<input name="url2" type="text" /></th>						                      
				                        </tr>
				                        <tr>
				                        	<th style="text-align: center;">内容：<input name="title2" type="text" /></th>
				                            <th style="text-align: center;">url:<input name="url2" type="text" /></th>
				                        </tr>
				                        <tr>
				                        	<th style="text-align: center;">内容：<input name="title2" type="text" /></th>
				                            <th style="text-align: center;">url:<input name="url2" type="text" /></th>				                          
				                        </tr>				                                              			
                       			</table>
		                    </td>
	                    </tr>
	                    <tr th:if="${footerL.size()==0}">
		                    <td>
		                    	标题：<input name="title" type="text"/>					                      
				                     
		                    </td>
		                    <td>
		                    <table class="table table-striped table-bordered bootstrap-datatable datatable">                       			 		
				                        <tr>
				                        	<th style="text-align: center;">内容：<input name="title3" type="text" /></th>
				                            <th style="text-align: center;">url:<input name="url3" type="text" /></th>
				                        </tr>
				                        <tr>
				                        	<th style="text-align: center;">内容：<input name="title3" type="text" /></th>
				                            <th style="text-align: center;">url:<input name="url3" type="text" /></th>				                      
				                        </tr>
				                        <tr>
				                        	<th style="text-align: center;">内容：<input name="title3" type="text" /></th>
				                            <th style="text-align: center;">url:<input name="url3" type="text" /></th>	
				                        </tr>
				                        <tr>
				                        	<th style="text-align: center;">内容：<input name="title3" type="text" /></th>
				                            <th style="text-align: center;">url:<input name="url3" type="text" /></th>				                          
				                        </tr>				                                              			
                       			</table>
		                    </td>
	                    </tr>
	                    <tr th:if="${footerL.size()==0}">
		                    <td>
		                    	标题：<input name="title" type="text"/>					                      
				                     
		                    </td>
		                    <td>
		                    <table class="table table-striped table-bordered bootstrap-datatable datatable">                       			 		
				                        <tr>
				                        	<th style="text-align: center;">内容：<input name="title4" type="text" /></th>
				                            <th style="text-align: center;">url:<input name="url4" type="text" /></th>
				                        </tr>
				                        <tr>
				                        	<th style="text-align: center;">内容：<input name="title4" type="text" /></th>
				                            <th style="text-align: center;">url:<input name="url4" type="text" /></th>						                      
				                        </tr>
				                        <tr>
				                        	<th style="text-align: center;">内容：<input name="title4" type="text" /></th>
				                            <th style="text-align: center;">url:<input name="url4" type="text" /></th>		
				                        </tr>
				                        <tr>
				                        	<th style="text-align: center;">内容：<input name="title4" type="text" /></th>
				                            <th style="text-align: center;">url:<input name="url4" type="text" /></th>					                          
				                        </tr>				                                              			
                       			</table>
		                    </td>
	                    </tr>
	                    <tr th:if="${footerL.size()==0}">
		                    <td>
		                    	标题：<input name="title" type="text"/>					                      
				                     
		                    </td>
		                    <td>
		                    <input type="file" name="file4"/>
		                    </td>
	                    </tr>
	                    <tr th:if="${footerL.size()==0}">
		                    <td>
		                    	标题：<input name="title" type="text"/>					                      
				                     
		                    </td>
		                    <td>
		                    <input type="file" name="file5"/>
		                    </td>
	                    </tr>
                    </table>
                   
                    <div class="modal-footer">
                        <input type="button" class="btn btn-primary btn-small" value="保存" name="isEmpty" onclick="submitF()"/>
                    </div>                    
                    </form>                      
                </div>
            </div><!--/span-->
        </div><!--/row-->
    </div>
</div>
</body>
</html>
